function []=plotnonlinobjective(F,width,height,KT)

params(1) = struct('name', 'focal','ymeasure','foc2' ,'xmeasure','foc1', 'yKrow', 1, 'yKcol', 1, 'xKrow',2, 'xKcol', 2);




K=[width 0 width/2; 0 width height/2; 0 0 1];
numsl=200;
numsols=numsl;

usedFs=[];
for i=1:size(F,2)
    if(size(F{1,i},1)~=0)
        usedFs=[usedFs i];
    end
end
origusedF=usedFs;
warning('off','signal:findpeaks:noPeaks');
k=0;

datapts=cell(size(usedFs,2),1);


ci=1;
 newusedFs=[];
for i=1:size(usedFs,2)
    [sols,xs]= provideFamilySolution_matrixnorm(F{1,usedFs(1,i)},width,height,2,numsl,K,'foc2');
    % [sols,xs]= provideFamilySolution_matrixnormPOLYFMIN(F{1,usedFs(1,i)},width,height,2,numsl,K,params(p).ymeasure);
    
    
    if(size(sols,1)>0)
        datapts{ci,1}(:,2)=sols;
        datapts{ci,1}(:,1)=xs;
        datapts{ci,1}(:,3)=ones(numsl,1)*usedFs(1,i);
        datapts{ci,1}(:,4)=zeros(numsl,1);
         newusedFs=[newusedFs usedFs(1,i)];
        ci=ci+1;
    end
    
end
usedFs= newusedFs;
side=400;
focal2start=KT(2,2)-side;
focal2end=KT(2,2)+side;

step=((focal2end-focal2start)/(numsols-1));
xarray2=focal2start:step:focal2end;

focal1start=KT(1,1)-side;
focal1end=KT(1,1)+side;

step=((focal1end-focal1start)/(numsols-1));
xarray1=focal1start:step:focal1end;

minx=10000000;
bestx=[0 ; 0];

obj=zeros(numsols,numsols);
for j=1:numsols
    for i=1:numsols
        
        foc2=xarray2(i);
        foc1=xarray1(j);
        
        obj(i,j)=geometricnonlinselfcal([foc1 ;   foc2],datapts,usedFs,width, height);
        if(obj(i,j)<minx)
            minx=obj(i,j);
            bestx=[foc1 ;   foc2];
        end
        
    end
end
[Xm,Ym] = meshgrid(xarray1,xarray2);
meshc(Xm,Ym,obj);
xlabel('focal length 1');
ylabel('focal length 2');

bestx

end

